package com.m1book.domain.book;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Field;

@Field("info")
public class DoubanBookInfo implements Serializable {
	private static final long serialVersionUID = 1321749038597410946L;
	
	@Indexed(unique = true)
	private String isbn10;
	
	@Indexed(unique = true)
	private String isbn13;
	
	@Indexed
	private String title;
	
	@Indexed
	private String author;
	
	@Indexed(unique = true)
	private String doubanId;
	
	private String selfLink;
	
	private String alternateLink;
	
	private String imageLink;
	
	private String summary;
	
	private String subTitle;
	
	private String authorInfo;
	
	private float price;
	
	private String publisher;
	
	private String binding;
	
	private String pubdate;
	
	private Map<String, Integer> tags;
	
	private float averageRating;
	
	private int numRaters;
	
	public DoubanBookInfo() {
		tags = new HashMap<String, Integer>();
	}

	public String getIsbn10() {
		return isbn10;
	}

	public void setIsbn10(String isbn10) {
		this.isbn10 = isbn10;
	}

	public String getIsbn13() {
		return isbn13;
	}

	public void setIsbn13(String isbn13) {
		this.isbn13 = isbn13;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getDoubanId() {
		return doubanId;
	}

	public void setDoubanId(String doubanId) {
		this.doubanId = doubanId;
	}

	public String getSelfLink() {
		return selfLink;
	}

	public void setSelfLink(String selfLink) {
		this.selfLink = selfLink;
	}

	public String getAlternateLink() {
		return alternateLink;
	}

	public void setAlternateLink(String alternateLink) {
		this.alternateLink = alternateLink;
	}

	public String getImageLink() {
		return imageLink;
	}

	public void setImageLink(String imageLink) {
		this.imageLink = imageLink;
	}

	public String getSummary() {
		return summary;
	}

	public void setSummary(String summary) {
		this.summary = summary;
	}

	public String getSubTitle() {
		return subTitle;
	}

	public void setSubTitle(String subTitle) {
		this.subTitle = subTitle;
	}

	public String getAuthorInfo() {
		return authorInfo;
	}

	public void setAuthorInfo(String authorInfo) {
		this.authorInfo = authorInfo;
	}

	public float getPrice() {
		return price;
	}

	public void setPrice(float price) {
		this.price = price;
	}

	public String getPublisher() {
		return publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}

	public String getBinding() {
		return binding;
	}

	public void setBinding(String binding) {
		this.binding = binding;
	}

	public String getPubdate() {
		return pubdate;
	}

	public void setPubdate(String pubdate) {
		this.pubdate = pubdate;
	}

	public Map<String, Integer> getTags() {
		return tags;
	}

	public void setTags(Map<String, Integer> tags) {
		this.tags = tags;
	}
	
	public String getTagsStr() {
		return tags.toString();
	}

	public float getAverageRating() {
		return averageRating;
	}

	public void setAverageRating(float averageRating) {
		this.averageRating = averageRating;
	}

	public int getNumRaters() {
		return numRaters;
	}

	public void setNumRaters(int numRaters) {
		this.numRaters = numRaters;
	}

	@Override
	public String toString() {
		return "DoubanBookInfo [isbn10=" + isbn10 + ", isbn13=" + isbn13
				+ ", title=" + title + ", author=" + author + ", doubanId="
				+ doubanId + ", selfLink=" + selfLink + ", alternateLink="
				+ alternateLink + ", imageLink=" + imageLink + ", summary="
				+ summary + ", subTitle=" + subTitle + ", authorInfo="
				+ authorInfo + ", price=" + price + ", publisher=" + publisher
				+ ", binding=" + binding + ", pubdate=" + pubdate + ", tags="
				+ tags + ", averageRating=" + averageRating + ", numRaters="
				+ numRaters + "]";
	}

}
